Different sources of noise in digital images may be acquired by image sensors in digital cameras, camcorders, and scanners. Noise characteristics in an image may be affected by many factors, such as sensor type, pixel dimensions, temperature, exposure time, etc. Noise often includes fluctuations in color and luminance. Color or “chroma” noise is usually more unnatural in appearance than luminance noise, and can render images unusable if not kept under control. For example, in a red-green-blue (RGB) color space, if the R, G, B components of a pixel (e.g., as a vector) in a Bayer image have a variety of directions, then chroma noise may appear in the image.
Various denoise techniques may be performed to reduce noise in digital images. For example, Gaussian low-pass filtering computes a weighted average of pixel values in a neighborhood, in which the weights decrease with distance from the neighborhood center. The assumption of Gaussian low-pass filtering is that images typically vary slowly over space and nearby pixels are likely to have similar values. It is therefore appropriate to average the pixel values together. Noise values that corrupt the nearby pixels are mutually less correlated than the signal values, so noise can be averaged away while signal values are preserved. However, the assumption of slow spatial variations fails at edges which are consequently blurred by Gaussian low-pass filtering.
Bilateral filtering is a non-linear, edge-preserving noise reduction technique. Bilateral filtering usually implements a domain filter and a range filter to reconstruct every pixel in an image. The domain filter indicates that the closer a neighbor pixel is to a target pixel, the higher the reference value of the neighbor pixel will be. Thus, a domain weight value of a neighbor pixel closer to a target pixel is higher when the target pixel is reconstructed according to each neighbor pixel. The range filter indicates that the more a neighbor pixel is similar (e.g., in terms of intensity, color, etc.) to a target pixel, the higher the reference value of the neighbor pixel will be. Thus, a range weight value of a neighbor pixel more similar to a target pixel is higher when the target pixel is reconstructed according to each neighbor pixel. For example, both the domain filter and the range filter are shift-invariant Gaussian filters. The reconstruction of the target pixel includes replacing the pixel value of the target pixel with a weighted average of pixel values of neighbor pixels. The bilateral filtering can preserve sharp edges by systematically looping through each pixel and adjusting weights to the neighbor pixels accordingly.